package com.example.springbootinit;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.Arrays;
import java.util.Map;

/**
 * @program: springboot1
 * @description:
 * @author: zhanghz001
 * @create: 2020-12-08 11:29
 **/
//1 加component 2 加configuration Properties
@Component
@ConfigurationProperties(prefix = "person")
public class Person {
    private String name;
    private String age;
    private Map<String, String> map;
    private String[] address;

    public String[] getAddress() {
        return address;
    }

    public void setAddress(String[] address) {
        this.address = address;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAge() {
        return age;
    }

    public void setAge(String age) {
        this.age = age;
    }

    public Map<String, String> getMap() {
        return map;
    }

    public void setMap(Map<String, String> map) {
        this.map = map;
    }

    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", age='" + age + '\'' +
                ", map=" + map +
                ", address=" + Arrays.toString(address) +
                '}';
    }
}
